#ifndef MYWIDGET_H
#define MYWIDGET_H

#include <QWidget>
#include <QMainWindow>
#include <QToolBar>
#include <QMenu>
#include <QTextEdit>
#include <QLayout>
#include <QLabel>
#include <QPushButton>
#include <QComboBox>
#include <QTextCodec>
#include <QTextCursor>
#include <QFile>
#include <QTextBlockFormat>
#include <QFileDialog>
#include <QScrollBar>
#include <QSettings>
#include <QTextBlockFormat>
#include <QMessageBox>
#include <QTextStream>
#include <QVBoxLayout>
#include <QColorDialog>
#include <QFontDialog>
#include <QFont>
#include <QDebug>
#include <QTextBlock>
#include <QScrollBar>
#include <QPoint>
#include <QSettings>
#include <QComboBox>
#include <QTimer>
#include <QLabel>
#include <QDateTime>

class MyWidget : public QWidget
{
    Q_OBJECT

public:
    MyWidget(QWidget *parent = 0);
    ~MyWidget();
    int num=12;
    int nTotalValue;

    int lineCount;  //行数统计

    QFont ft;
    QTextDocument *doc;
    QScrollBar *SBn;
    int m;
    int savevalue;  //保存书签
    int b1,b2,b3,b4,b5,b6,b7,b8;  //记录书签，最多记录8个
    int cbnum=0;   //书签计数

    QAction *openAction;
    QAction *fonts;
    QAction *bookmark;
    QAction *previous;
    QAction *nextd;
    QAction *enlarges;
    QAction *narrow;
    QAction *clearbook;
    QAction *fontcolor;
    QAction *closefile;
    QAction *booklist;

    QLabel *valtime;  //显示时间栏

private:
    QMenu *Rmenu;//右键菜单
    QString filepath;
    QTextEdit *Display;

    QPalette palette;

    QComboBox *bookmarklist;

public slots:
    void openBook();
    void openFile(QString filepath, int x);
    void closeBook();
    void setwType();
    void setColor();
    void texplus();  //文本放大缩小
    void reduce();
    void previousu(); //上一页
    void nextp();  //下一页
    void saveMark();  //保存书签
    void openmark();  //打开书签
    void clearmark();  //清空书签
    void getTime();



};

#endif // MYWIDGET_H
